/*******************************************************************************
 * Copyright (c) 2002, 2014 IBM Corp. and others
 *
 * This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License 2.0 which accompanies this
 * distribution and is available at https://www.eclipse.org/legal/epl-2.0/
 * or the Apache License, Version 2.0 which accompanies this distribution and
 * is available at https://www.apache.org/licenses/LICENSE-2.0.
 *
 * This Source Code may also be made available under the following
 * Secondary Licenses when the conditions for such availability set
 * forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
 * General Public License, version 2 with the GNU Classpath
 * Exception [1] and GNU General Public License, version 2 with the
 * OpenJDK Assembly Exception [2].
 *
 * [1] https://www.gnu.org/software/classpath/license.html
 * [2] http://openjdk.java.net/legal/assembly-exception.html
 *
 * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
 *******************************************************************************/
#define true 1
#define false 0
#include "floatsanityg.h"


   void group_java_lang_Math_acos() {
      int i=0, groupNum=29,numTests=132;
      int testsPassed=0, testsFailed=0;
      unsigned int op_0 [] = {
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff00000, 
         0x00000000,0xfff00000, 
         0x9999999a,0x3ff19999, 
         0x9999999a,0xbff19999, 
         0xf95ac4e8,0x3fd58139, 
         0xca24770c,0x3fd4d753, 
         0xe2ee80f8,0x3fe1f1b5, 
         0xb7f0c2cd,0x3fe49c30, 
         0xb0e4050c,0x3fe7d46b, 
         0x09547674,0x3fc0e1f1, 
         0xa53076c8,0x3fd1a461, 
         0x187c4bbf,0x3fe6d154, 
         0xf9d650c2,0x3fe7ba16, 
         0x11a7fd62,0x3fe8ff6c, 
         0x212ad2cc,0x3fda4581, 
         0xe8c22c3c,0x3fd48eb0, 
         0x7edbf5f0,0x3fde27bd, 
         0xdca6b9ac,0x3fc04b98, 
         0x547f8161,0x3fe1d234, 
         0x8232e8e3,0x3fe3af12, 
         0xf31f38d8,0x3fe8cf7c, 
         0x3cd8f2bf,0x3fe87105, 
         0x96cf3360,0x3f932ffb, 
         0x50af46e8,0x3fb378cd, 
         0xd7e968a9,0x3ff921f0, 
         0x54442d18,0xc01921fb, 
         0x54442d1b,0x3ff921fb, 
         0xffffffff,0xffefffff, 
         0xcccccccc,0xffeccccc, 
         0x99999999,0xffe99999, 
         0x66666666,0xffe66666, 
         0x33333333,0xffe33333, 
         0x00000000,0xffe00000, 
         0x9999999a,0xffd99999, 
         0x33333334,0xffd33333, 
         0x9999999c,0xffc99999, 
         0x9999999f,0xffb99999, 
         0x00000000,0xfc980000, 
         0x99999993,0x7fb99999, 
         0x99999996,0x7fc99999, 
         0x33333331,0x7fd33333, 
         0x99999997,0x7fd99999, 
         0xfffffffd,0x7fdfffff, 
         0x33333332,0x7fe33333, 
         0x66666665,0x7fe66666, 
         0x99999998,0x7fe99999, 
         0xcccccccb,0x7feccccc, 
         0xfffffffe,0x7fefffff, 
         0x00000000,0xc32fc000, 
         0xffffffff,0x7fefffff, 
         0x2,0x0, 
         0x9,0x0, 
         0x00000000,0x40000, 
         0x00000000,0x80000, 
         0xfffffffe,0xfffff, 
         0xffffffff,0xfffff, 
         0x00000002,0x80000000, 
         0x00000009,0x80000000, 
         0x00000000,0x80040000, 
         0x00000000,0x80080000, 
         0xfffffffe,0x800fffff, 
         0xffffffff,0x800fffff, 
         0x47ae149b,0x408fb4e1, 
         0xb851eb95,0x4090961e, 
         0x00000000,0xc0863000, 
         0x851eb852,0xc08627eb, 
         0x28f5c132,0x4051ef5c, 
         0x3def12b7,0x3ff0a2b2, 
         0x3e33cae7,0x3ff0a2b2, 
         0x3f8b63d7,0x3ff0a2b2, 
         0xffffffff,0xbfefffff, 
         0xfffffff0,0x3fefffff, 
         0xffffffff,0x3fefffff, 
         0xfffffe14,0x3fefffff, 
         0xc4e8043a,0xc0152c38, 
         0xb06d22f4,0xc014e48a, 
         0x3fc94bea,0xc014da4d, 
         0xcf2574f8,0xc010d00f, 
         0x192c3200,0xc0014e34, 
         0x82c60fb8,0x40124ea8, 
         0xf369e6c2,0x401258e5, 
         0x1c5fa942,0x4014e842, 
         0x0962a17e,0xbff80d0c, 
         0xcbf1fda5,0xbff03601, 
         0x4888e3a9,0x3ff111ac, 
         0x4888e3ab,0x3ff911ac, 
         0x1687291c,0x3fefced9, 
         0x8b439398,0x3fefe76c, 
         0x45a1c8d6,0x3feff3b6, 
         0xd9168540,0x3feff7ce, 
         0x2110f9fe,0xc014eec8, 
         0xb3a09a7b,0x400d7e98, 
         0x2da71340,0xc00295e2, 
         0xf69d5e8e,0x3ffff2f3, 
         0xf369e6ce,0x401058e5, 
         0x4c5f64e4,0xc00e8167, 
         0x4fdf3b6a,0x3fc6978d, 
         0x78d4fdf8,0x3fd126e9, 
         0x4fdf3b69,0x3fd2978d, 
         0x9db22d14,0x3fd6a7ef, 
         0xef9db233,0x3fd7c6a7, 
         0x645a1cb2,0x3fd7df3b, 
         0x9ba5e35a,0x3fd820c4, 
         0x24dd2f21,0x3fd98106, 
         0x645a1cb3,0x3fdbdf3b, 
         0x9ba5e35b,0x3fdc20c4, 
         0xc28f5c30,0x3fdc28f5, 
         0x7ef9db2a,0x3fdcbc6a, 
         0x1cac0839,0x3fdf645a, 
         0x26e978d8,0x3fe00831, 
         0x083126ea,0x3fe01cac, 
         0x5810623c,0x3fe0b439, 
         0x7ef9db10,0x3fe0bc6a, 
         0x353f7cbc,0x3fe1ba5e, 
         0xef9db1fa,0x3fe1c6a7, 
         0xa9fbe738,0x3fe1d2f1, 
         0x3d70a3a2,0x3fe1d70a, 
         0x083126ac,0x3fe21cac, 
         0xe353f782,0x3fe29ba5, 
         0xed916812,0x3fe33f7c, 
         0xdf3b63f0,0x3fe38d4f, 
         0x72b0205a,0x3fe39168, 
         0x9999992e,0x3fe39999, 
         0xba5e34c6,0x3fe40c49, 
         0xae147a4e,0x3fe4e147, 
         0xb22d0da2,0x3fe5ef9d, 
         0x851eb792,0x3fe651eb, 
         0xb439574c,0x3fe676c8, 
         0x4dd2f0b4,0x3fe81062, 
         0x374bc5ac,0x3fe84189, 
         0x126e9644,0x3feac083, 
         0x0, 0x0};
      unsigned int result [] = {
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x6f7b115f,0x3ff3a65d, 
         0xdec543c2,0x3ff3d35f, 
         0xde2015bc,0x3fef3747, 
         0x980e1679,0x3febdf2f, 
         0x4a4342bd,0x3fe7623a, 
         0x0928bcbc,0x3ff70429, 
         0x19d8cbf9,0x3ff4aa13, 
         0x87b2ba82,0x3fe8dccd, 
         0xfa588ddb,0x3fe78992, 
         0x1c10a95c,0x3fe59367, 
         0x32fc72af,0x3ff25d66, 
         0xa3e0e059,0x3ff3e690, 
         0xc1392132,0x3ff14863, 
         0xfb7e8130,0x3ff7171c, 
         0xdbae5140,0x3fef5d45, 
         0x6dc5a123,0x3fed1070, 
         0x10b21b13,0x3fe5dfbd, 
         0x63661a60,0x3fe673af, 
         0x3f87b653,0x3ff8d53a, 
         0x643326db,0x3ff7ea21, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x54442d18,0x3ff921fb, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x52442d18,0x400921fb, 
         0x00000001,0x3e700000, 
         0x00000000,0x3e500000, 
         0xcd0c3eda,0x3e962e5a, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x198d366e,0x3fbc0eb4, 
         0xac138eb0,0x3fb3d5aa, 
         0xbd7b326a,0x3fac0c01, 
         0xe56950fb,0x3fa6e634, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x00000000,0x7ff80000, 
         0x077d3ea4,0x3ff64b3b, 
         0x5e885abe,0x3ff4caab, 
         0x414b1c33,0x3ff46ab0, 
         0xc0b1f394,0x3ff357dd, 
         0x01b14119,0x3ff30af2, 
         0x5a0c358e,0x3ff30453, 
         0xde29f8f6,0x3ff2f2a6, 
         0x2a1606bd,0x3ff2931c, 
         0xa6b36449,0x3ff1ec59, 
         0x4190a0c7,0x3ff1da21, 
         0x7e9ecca4,0x3ff1d7d9, 
         0x3ef115be,0x3ff1aeb2, 
         0xc4aa32ba,0x3ff0ee1c, 
         0x06273835,0x3ff0bc97, 
         0x7b963b72,0x3ff0b0bf, 
         0x96abbdde,0x3ff0587b, 
         0xc9c52a90,0x3ff053ad, 
         0x257c263e,0x3fef79f0, 
         0x4cc09e14,0x3fef6b2b, 
         0xe4df66f1,0x3fef5c61, 
         0x12ef9555,0x3fef5773, 
         0x14c488c5,0x3fef0348, 
         0x677a3489,0x3fee683e, 
         0x170b504e,0x3fed9d08, 
         0x033af750,0x3fed3b2c, 
         0x1cb3269f,0x3fed35ff, 
         0x5e36fb6d,0x3fed2ba3, 
         0x59896833,0x3fec9988, 
         0xabefb21b,0x3feb8471, 
         0x42622669,0x3fea18a0, 
         0x35cdb166,0x3fe99089, 
         0xf4baca4e,0x3fe95cee, 
         0x76c10db4,0x3fe707d3, 
         0xcfdab217,0x3fe6bcdd, 
         0x77bfd3de,0x3fe29645, 
         0x0, 0x0};
      double *p0=(double *) op_0;
      double *erp=(double*) result, r, *rp=&r;
      for (i=0; i<numTests; i++) {
         r = java_lang_Math_acos(*(p0));
         if ( IS_DNAN(erp) ){
            if ( !(IS_DNAN(&r)) ){
               printf("%d.%d: op_0=0x%08x%08x Expected=0x%08x%08x Actual=0x%08x%08x \n",
                  groupNum, i, 
                  *((int *)p0+1), *(int *)p0, *((int *) erp + 1), *(int *)erp, *((int *) &r + 1), *(int *)&r);
               testsFailed++;
            } else {
               testsPassed++;
            }

         } else {
            if (HIWORD(&r) != HIWORD(erp) || abs(LOWORD(&r) - LOWORD(erp)) > 1) {
               printf("%d.%d: op_0=0x%08x%08x Expected=0x%08x%08x Actual=0x%08x%08x \n",
                  groupNum, i, 
                  *((int *)p0+1), *(int *)p0, *((int *) erp + 1), *(int *)erp, *((int *) &r + 1), *(int *)&r);
               testsFailed++;
            } else {
               testsPassed++;
            }
         }

         p0++;erp++;
      }
      printf("[%d] %s Passed %d Failed %d Total %d \n", groupNum,"java_lang_Math_acos", testsPassed, testsFailed, numTests);
      totalNumTest +=numTests; totalTestsPassed +=testsPassed; totalTestsFailed +=testsFailed;
   }

